package com.xyb.entity;

public enum StatusCode{
    SUCCESS(200,"success"),
    ERROR(500,"error"),
    UNDEFINED_ERROR(50000,"未知异常"),
    //后端开发提示
    NULL_POINTER_EXCEPTION(50001,"空指针异常"),
    //前后端联调开发提示
    DATA_VALIDATION_EXCEPTION(50002,"数据校验异常"),
    REQUEST_METHOD_EXCEPTION(50003,"请求类型异常"),
    REQUEST_BODY_EXCEPTION(50004,"请求体非法异常"),

    //业务提示
    ADMIN_REFUSED_EXCEPTION(10000,"超级管理员非法操作,可能导致系统崩溃!"),
    USER_NOT_EXIST_EXCEPTION(10001,"用户不存在"),
    USER_HAS_EXIST_EXCEPTION(10002,"用户已存在"),
    PHONE_NO_NOT_REGISTERED_EXCEPTION(10003,"手机号未注册"),
    USERNAME_OR_PASSWORD_ERROR_EXCEPTION(10004,"账号或密码错误"),
    ACCOUNT_LOCK_EXCEPTION(10005,"账号已冻结"),
    PHONE_HAS_REGISTERED_EXCEPTION(10006,"手机号已经注册"),

    TOKEN_EXPIRED_EXCEPTION(10010,"token过期异常"),
    TOKEN_PARSE_EXCEPTION(10011,"token解析异常"),

    VERIFY_CODE_EXCEPTION(10020,"验证码无效或过期"),
    ;

    private int code;
    private String msg;

    StatusCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
